import request from '@/utils/request'

export function listUserGroup(data) {
  return request({
    url: '/api/uc/user_group/page',
    method: 'post',
    data
  })
}

export function saveUserGroup(data) {
  return request({
    url: '/api/uc/user_group/save',
    method: 'post',
    data
  })
}

export function updateUserGroup(data) {
  return request({
    url: '/api/uc/user_group/update',
    method: 'post',
    data
  })
}

export function deleteUserGroup(data) {
  return request({
    url: '/api/uc/user_group/delete',
    method: 'post',
    data
  })
}

export function listUserGroupTreeItemForManage(data) {
  return request({
    url: '/api/uc/user_group/list_tree_item_for_manage',
    method: 'post',
    data
  })
}

export function listRoleId(data) {
  return request({
    url: '/api/uc/user_group/list_role_id',
    method: 'post',
    data
  })
}

export function listMyUserGroup(data) {
  return request({
    url: '/api/uc/user_group/list_my',
    method: 'post',
    data
  })
}

/**
 * 获取个人名下的所有部门，团队
 * @param data
 * @returns {AxiosPromise}
 */
export function listUserGroupAll(data) {
  return request({
    url: '/api/uc/user_group/list_my_all',
    method: 'post',
    data
  })
}

export function getUserGroup(data) {
  return request({
    url: '/api/uc/user_group/get',
    method: 'post',
    data
  })
}

